﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HZ.Supervise.Model;

namespace HZ.Supervise.Web.Message
{
    public partial class MessagePrescriptionDetail : System.Web.UI.Page
    {
        IBLL.IBLL_MessageTypeDetail ibllMessage = new BLL.BLL_MessageTypeDetail();
        string id;
        string _PrescriptionDetailId;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
               _PrescriptionDetailId= Request["pid"];
               BindData(_PrescriptionDetailId);
            }
        }
        void BindData(string _PrescriptionDetailId)
        {
            if (!string.IsNullOrEmpty(_PrescriptionDetailId))
            {
                int t = 0;
                Model.Prescription p = new Prescription();
                gvwMessageDetailList.DataSource = ibllMessage.GetMessagePrescriptionDetail(_PrescriptionDetailId, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out t,out p);
                this.lblhosname.Text = p.PHospitalName;
                this.lblname.Text = p.PrescriptionName;
                this.lblPatientName.Text = p.PatientName;
                this.lblPdoctorName.Text = p.PdoctorName;
                this.lblPsympToms.Text = p.PsympToms;
                this.lblTime.Text = p.PSubmitTime.ToString();
                gvwMessageDetailList.DataBind();
                AspNetPager1.RecordCount = t;
            }

        }
        protected void btnExit_Click(object sender, EventArgs e)
        {
          //  Response.Redirect("MessageList.aspx");
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            BindData(_PrescriptionDetailId);
        }
    }
}
